<?= $this->element('finance_submenu', array('page' => 'expense')) ?>
<p><?= $this->Html->link("+" . __('new') . " " . __('expense'), array('action'=>'create', 'expense')) ?></p>

<? if(count($data)>0): ?>
<table>
	<tr>
		<th width="1%"><?= __('id') ?></th>
		<th width="13%"><?= __('date') ?></th>
		<th width="25%"><?= __('receiver') ?></th>
		<th width="15%"><?= __('amount') ?></th>
		<th><?= __('description') ?></th>
		<th width="1%"></th>
	</tr>
	<? foreach($data as $row): ?>
	<tr>
		<td><?= $this->Html->link(sprintf("%04d", $row['Finance']['id']), "/finance/edit/" . $row['Finance']['id']) ?></td>
		<td><?= date('d.M Y', strtotime($row['Finance']['date'])) ?></td>
		<td><?= $row['Finance']['entity'] ?></td>
		<td align="right"><?= number_format($row['Finance']['amount'], 2, ",", ".") ?></td>
		<td><?= $row['Finance']['description'] ?></td>
		<td>
			<?= $this->Html->link(__('delete'), array('action'=>'delete', 'expense', $row['Finance']['id']), array('onclick'=>"return confirm('".__("Do you want to delete expense?")."')")) ?>
		</td>
	</tr>
	<? endforeach; ?>
</table>
<?= $this->element('pagination') ?>
<? else: ?>
<p><?= __('There\'s no expenses') ?>.</p>
<? endif; ?>